bitkeeper revision 1.1601 (429c1ed4wKexKmX-ibC6x3hHrciDNQ)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 31 May 2005 08:22:44 +0000 (08:22 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 31 May 2005 08:22:44 +0000 (08:22 +0000)
Fix CPU detection and initialisation. We now do early detection very
early, but pushed full initialisation to somewhat later when other
infrastructure is properly ready.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/apic.c
xen/arch/x86/cpu/common.c
xen/arch/x86/setup.c

index 684a1805409f02fd997a6a4d4c866e757838241c..dea77354a2269e0e8f8abbb631afd2bc0a2ed743 100644 (file)
@@ -493,14 +493,13 @@ custom_param("apic_verbosity", apic_set_verbosity);
 static int __init detect_init_APIC (void)
 {
     u32 h, l, features;
-    extern void get_cpu_vendor(struct cpuinfo_x86*);
 
     /* Disabled by kernel option? */
     if (enable_local_apic < 0)
         return -1;
 
     /* Workaround for us being called before identify_cpu(). */
-    get_cpu_vendor(&boot_cpu_data);
+    /*get_cpu_vendor(&boot_cpu_data); Not for Xen */
 
     switch (boot_cpu_data.x86_vendor) {
     case X86_VENDOR_AMD:
index 145ef6187fd07c34b3f7e1f8d6ef66b62f6e4fdb..8b319f1a1ba1ef25086c9fc529cea85abb2522ce 100644 (file)
@@ -223,6 +223,7 @@ void __init early_cpu_detect(void)
                c->x86_mask = tfms & 15;
                if (cap0 & (1<<19))
                        c->x86_cache_alignment = ((misc >> 8) & 0xff) * 8;
+               c->x86_capability[0] = cap0; /* Added for Xen bootstrap */
        }
 
        early_intel_workaround(c);
index d1d89ef4a3506c90abf7e4c8786c65a0c20670c1..bd21c5bb181cf78e4ea2db983174aea17faedb40 100644 (file)
@@ -85,7 +85,7 @@ extern void early_cpu_init(void);
 
 extern unsigned long cpu0_stack[];
 
-struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1 };
+struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
 
 #if defined(CONFIG_X86_64)
 unsigned long mmu_cr4_features = X86_CR4_PSE | X86_CR4_PGE | X86_CR4_PAE;
@@ -144,6 +144,8 @@ static void __init start_of_day(void)
 {
     int i;
 
+    early_cpu_init();
+
     /* Unmap the first page of CPU0's stack. */
     memguard_guard_stack(cpu0_stack);
 
@@ -161,14 +163,6 @@ static void __init start_of_day(void)
         GDT_VIRT_START(current) + FIRST_RESERVED_GDT_BYTE,
         virt_to_phys(gdt_table) >> PAGE_SHIFT, 1, PAGE_HYPERVISOR);
 
-    /* Process CPU type information. */
-    early_cpu_init();
-    identify_cpu(&boot_cpu_data);
-    if ( cpu_has_fxsr )
-        set_in_cr4(X86_CR4_OSFXSR);
-    if ( cpu_has_xmm )
-        set_in_cr4(X86_CR4_OSXMMEXCPT);
-
     find_smp_config();
 
     smp_alloc_memory();
@@ -199,6 +193,12 @@ static void __init start_of_day(void)
 
     scheduler_init();  
 
+    identify_cpu(&boot_cpu_data);
+    if ( cpu_has_fxsr )
+        set_in_cr4(X86_CR4_OSFXSR);
+    if ( cpu_has_xmm )
+        set_in_cr4(X86_CR4_OSXMMEXCPT);
+
     if ( opt_nosmp )
         max_cpus = 0;
     smp_prepare_cpus(max_cpus);